<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

use App\Middleware\AuthMiddleware;
use App\Middleware\EncryptionMiddleware;
use Hyperf\HttpServer\Router\Router;

Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index');


Router::get('/favicon.ico', function () {
    return '';
});

Router::addGroup('',function (){
    // 文件准备
    Router::addRoute(['POST','GET'], '/event/pack/download', 'App\Controller\AdminController@downloadEventPack');
    // 修改密码
    Router::addRoute(['POST'],'/edit/password','App\Controller\StudentController@editPassword');
    //
    Router::addRoute(['POST'],'/add/student','App\Controller\StudentController@addStudent');
},['middleware' => [AuthMiddleware::class, EncryptionMiddleware::class]]);

Router::addGroup('',function (){
    // 文件下载
    Router::addRoute(['GET'], '/event/pack/d', 'App\Controller\AdminController@d');
},['middleware' => [EncryptionMiddleware::class]]);




